package com.tiancheng.trade.settlement.service.settlement.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tiancheng.trade.settlement.mapper.settlement.SettlementBankWaitBillMapper;
import com.tiancheng.trade.settlement.model.settlement.SettlementBankWaitBill;
import com.tiancheng.trade.settlement.service.settlement.ISettlementBankWaitBillService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 银行待对账
 *
 * @author wangxin
 */
@Slf4j
@Service
public class SettlementBankWaitBillService implements ISettlementBankWaitBillService {

    @Autowired
    private SettlementBankWaitBillMapper settlementBankWaitBillMapper;

    @Override
    public List<SettlementBankWaitBill> queryBankWaitBillList(String billStatus) {
        QueryWrapper<SettlementBankWaitBill> conditions = new QueryWrapper<>();
        conditions.eq("bill_status", billStatus);
        conditions.isNotNull("sub_order_id");
        conditions.orderByDesc("id");
        conditions.last("limit 200");
        return settlementBankWaitBillMapper.selectList(conditions);
    }
}
